/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"34BA42BA-25F8-4C66-BF17-57F6B3864D3F"}
 */
var fPass = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"343EAF65-F186-476C-AC54-001946C9CEE5"}
 */
var fPass2 = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3FA0A3B7-F1EB-4B6D-8B46-83627FE46194"}
 * @AllowToRunInFind
 */
function grabar(event) {
	if (fPass == fPass2 && fPass != null)
	{
		hash_pass = globals.hashPass(fPass)
		fPass 	= null
		fPass2 	= null
	}
	else
		if (fPass != null)
		{
			fPass 	= null
			fPass2 	= null
			globals.gDialog('Error','Verificacion de contraseña fallo','OK','CerrarForm')
		}
	databaseManager.saveData()
	globals.gDialog('Exito','Cambios confirmados','OK','CerrarForm')
	databaseManager.setAutoSave(true)
	globals.show('productos_filtros')	
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"CBD25DC5-2F96-462B-855C-4C18F00EFE0D"}
 */
function onShowForm(firstShow, event) {
	databaseManager.setAutoSave(false)
	fPass	= null
	fPass2 	= null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"9CF3D5EE-BEB6-4627-8576-983B0FE75011"}
 */
function cancelar(event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	globals.show('productos_filtros')
}
